<html>

<head>
    <script src="jquery-3.2.1.min.js"></script>
    <script>
        $(function () {
            $('p:first').click(function () {
                var txt = 'text:' + $(this).text();
                $('div.dv_show').slideDown().html(txt);
            });
            $('button:first').click(function () {
                var txt = 'html:' + $('p:first').html();
                $('div.dv_show').slideDown().html(txt);
            });

        });
        function getValue() {
            var txt = $('input[type=text]').val();
            $('div.dv_show').slideDown().html(txt);
        }
        function setAttr() {
            var txt = $('input:eq(1)').attr('onclick');
            $('div.dv_show').slideDown().html(txt);
        }
    </script>
    <style>
        .dv_show {
            width: 400px;
            height: 80px;
            font-size: 20px;
            background-color: pink;
            display: none;
        }
    </style>
</head>
<div>
    <div class="dv_show"></div>
    <p>the first <b>p</b> content</p>
    <button type="button">获取html值</button>
    <input type="text" value="sh,ss" onclick="getValue()" />
    <input type="text" value="saaa" onclick="setAttr()" />
</div>

</html>